<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->

    <!-- 操作按钮区域 -->

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <userPayConfig-modal ref="modalForm" @ok="modalFormOk"></userPayConfig-modal>
  </a-card>
</template>

<script>
  import '@/assets/less/TableExpand.less'
  import UserPayConfigModal from './modules/UserPayConfigModal'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'

  export default {
    name: "UserPayConfigList",
    mixins: [JeecgListMixin],
    components: {
      UserPayConfigModal
    },
    data() {
      return {
        description: '支付配置表管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: "center",
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },
          {
            title: '是否开启支付',
            align: "center",
            dataIndex: 'isStartPayment',
            customRender: function (t, r, index) {
              if (t == 0) {
                return "禁用"
              }
              if (t == 1) {
                return "启用"
              }
            }
          },
          {
            title: '是否开启提现',
            align: "center",
            dataIndex: 'isStartWithdraw',
            customRender: function (t, r, index) {
              if (t == 0) {
                return "禁用"
              }
              if (t == 1) {
                return "启用"
              }
            }
          },
          {
            title: '充值比例',
            align: "center",
            dataIndex: 'rechargeRatio'
          },
          {
            title: '用户直推佣金',
            align: "center",
            dataIndex: 'userDirectPushCommission',
            customRender: function (t, r, index) {
              return t + "%";
            }
          },
          {
            title: '陪诊师直推佣金',
            align: "center",
            dataIndex: 'escortDirectPushCommission',
            customRender: function (t, r, index) {
              return t + "%";
            }
          },
          {
            title: '订单过期时长',
            align: "center",
            dataIndex: 'orderExpirationTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: "center",
            scopedSlots: {customRender: 'action'},
          }
        ],
        url: {
          list: "/user/userPayConfig/list",
          delete: "/user/userPayConfig/delete",
          deleteBatch: "/user/userPayConfig/deleteBatch",
          exportXlsUrl: "user/userPayConfig/exportXls",
          importExcelUrl: "user/userPayConfig/importExcel",
        },
      }
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {}
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>